var jsonString = {
    "MOC": [
        {
            "pos": "116.395983,39.993447",
            "name": "鸟巢"
        },
        {
            "pos": "115.791631130643,40.525042588976",
            "name": "延庆奥运村"
        },
        {
            "pos": "115.45676,40.924727",
            "name": "张家口奥运村"
        },
        {
            "pos": "115.788728298612,40.519840494792",
            "name": "延庆山地媒体中心"
        },
        {
            "pos": "116.233214,39.906422",
            "name": "国际广播中心"
        }
    ],
    "venue": [
        {
            "pos": "115.812538791233,40.547402615018",
            "name": "国家高山滑雪中心"
        },
        {
            "pos": "115.787294379341,40.524859483507",
            "name": "国家雪车雪橇中心"
        },
        {
            "pos": "116.3904,39.99283",
            "name": "水立方"
        },
        {
            "pos": "116.390241,39.996243",
            "name": "国家体育馆"
        },
        {
            "pos": "116.280747,39.911152",
            "name": "五棵松体育馆"
        },
        {
            "pos": "116.327437,39.940041",
            "name": "首都体育馆"
        },
        {
            "pos": "116.377434,40.017583",
            "name": "国家速滑馆"
        }
    ],
    "car": [
        {
            "pos": "115.276396,40.968996",
            "name": "崇礼汽车站"
        },
        {
            "pos": "114.883705,40.756067",
            "name": "张家口汽车客运南站"
        },
        {
            "pos": "114.875331,40.810022",
            "name": "西河沿客运站"
        },
        {
            "pos": "114.880699,40.834176",
            "name": "张家口汽车客运站"
        },
        {
            "pos": "115.985279,40.46178",
            "name": "延庆汽车站"
        }
    ],
    "service": [
        {
            "pos": "115.926297,40.488696",
            "name": "阪泉服务区"
        }
    ],
    "station": [
        {
            "pos": "116.427694,39.902779",
            "name": "北京站"
        },
        {
            "pos": "116.353063,39.944876",
            "name": "北京北站"
        },
        {
            "pos": "116.378517,39.865246",
            "name": "北京南站"
        },
        {
            "pos": "116.322056,39.89491",
            "name": "北京西站"
        },
        {
            "pos": "116.485079,39.90242",
            "name": "北京东站"
        },
        {
            "pos": "116.314257,40.041626",
            "name": "清河站"
        },
        {
            "pos": "116.231525,40.231452",
            "name": "昌平北站"
        },
        {
            "pos": "116.130015,40.23983",
            "name": "南口站"
        },
        {
            "pos": "116.001502,40.36009",
            "name": "八达岭站"
        },
        {
            "pos": "115.984385,40.436481",
            "name": "延庆站"
        },
        {
            "pos": "115.898445,40.379846",
            "name": "康庄站"
        },
        {
            "pos": "114.888666,40.813614",
            "name": "张家口站"
        },
        {
            "pos": "114.882686,40.750754",
            "name": "张家口南站"
        },
        {
            "pos": "115.448251,40.914304",
            "name": "太子城站"
        }
    ],
    "hotel": [
        {
            "pos": "115.820826,40.463101",
            "name": "延庆度假村"
        },
        {
            "pos": "115.962737,40.439801",
            "name": "世园海泉湾商务酒店"
        },
        {
            "pos": "115.963887,40.441352",
            "name": "北京世园凯悦酒店"
        },
        {
            "pos": "115.975139,40.477732",
            "name": "智选假日酒店"
        },
        {
            "pos": "115.980522,40.471334",
            "name": "中银酒店"
        },
        {
            "pos": "115.820764,40.463238",
            "name": "辉煌松山度假酒店"
        },
        {
            "pos": "116.001547,40.528596",
            "name": "快乐假日大酒店"
        },
        {
            "pos": "115.98902,40.451392",
            "name": "新华保险培训中心"
        },
        {
            "pos": " 115.779656575521,40.52323296441",
            "name": "096主转播商驻地"
        }
    ],
    "airport": [
        {
            "pos": "116.603039,40.080525",
            "name": "北京首都国际机场"
        },
        {
            "pos": "116.429172,39.510561",
            "name": "北京大兴国际机场"
        },
        {
            "pos": "114.955452,40.74646",
            "name": "张家口宁远机场"
        }
    ]
}

function getPOILocByType(type) {
    return jsonString[type];
}

function getPOILocByName(name) {//根据POIjson中的名字获取到对应的经纬度坐标
    for (var type in jsonString) {
        var jo = jsonString[type];
        for (var i = 0; i < jo.length; i++) {
            if (jo[i]["name"] == name) {
                return jo[i]["pos"];
            }
        }
    }
    return "error";
}